package com.example.ujsfish.model.manual;

public class SemiManualCtrlData {

    private volatile static SemiManualCtrlData.SemiAutoBody semiAutoBody = null;

    //DataAnalysis单例模式
    private volatile static SemiManualCtrlData semiManualCtrlDataInstance = null;
    private SemiManualCtrlData(){}

    public static SemiManualCtrlData getSemiManualCtrlDataInstance(){
        if (semiManualCtrlDataInstance == null){
            synchronized (ManualControlData.class){
                semiManualCtrlDataInstance = new SemiManualCtrlData();
            }
        }
        return semiManualCtrlDataInstance;
    }

    public static SemiAutoBody getManualBody(){
        if (semiAutoBody == null){
            synchronized (ManualControlData.class){
                semiAutoBody = new SemiManualCtrlData.SemiAutoBody();
            }
        }
        return semiAutoBody;
    }

    public static void setSemiManualCtrlDataInstance(SemiManualCtrlData semiManualCtrlDataInstance) {

        SemiManualCtrlData.semiManualCtrlDataInstance = semiManualCtrlDataInstance;
    }

    public static class SemiAutoBody {

        /**
         * 目标点X坐标
         */
        private String x_coordinate = "";
        /**
         * 目标点Y坐标
         */
        private String y_coordinate = "";
        private String feed = "0";//投饵抛盘占空比
        private String blanking = "0";//下料占空比
        private String valve = "0";//施药阀门占空比
        private String pump = "0";//施药液泵占空比
        private String device_name = "003900425850500C20353555"; //设备名

        private SemiAutoBody() {
        }

        public void setPara(String X_coordinate,String Y_coordinate, String sell, String bait, String medicineValue, String medicinePump, String device_name) {
            this.x_coordinate = X_coordinate;
            this.y_coordinate = Y_coordinate;
            this.feed = sell;
            this.blanking = bait;
            this.valve = medicineValue;
            this.pump = medicinePump;
            this.device_name = device_name;
        }

        public String getFeed() {
            return feed;
        }

        public String getBlanking() {
            return blanking;
        }

        public String getValve() {
            return valve;
        }

        public String getPump() {
            return pump;
        }

        public String getDevice_name() {
            return device_name;
        }

        public void setDevice_name(String device_name) {
            this.device_name = device_name;
        }


        @Override
        public String toString() {
            return "SemiAutoBody{" +
                    "X_coordinate='" + x_coordinate + '\'' +
                    ", Y_coordinate='" + y_coordinate + '\'' +
                    ", feed='" + feed + '\'' +
                    ", blanking='" + blanking + '\'' +
                    ", valve='" + valve + '\'' +
                    ", pump='" + pump + '\'' +
                    ", device_name='" + device_name + '\'' +
                    '}';
        }
    }
}
